<?php

	session_start();
	if($_SESSION["username"] == "")
	{
		header("location:login.php");
		exit();
	}

	include 'connectDB.php';

	$strSQL = "SELECT * FROM tbl_user WHERE username = '".$_SESSION["username"]."'  ";
	$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
	$objResult = mysql_fetch_array($objQuery);
?>
<html>
<head>
	<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
	<div id="header">
		<p >Add Item Page.</p>
	</div>
	<div id="container">
		<a href="dashboard.php">dashboard</a> > <a href="Item.php">item</a> > <a href="">Add item</a>
		<br>
		<br>

		<form name="frmAddItem" action="addItemSave.php" method="post">
		<table border="0 " cellpadding="10" cellspacing="0" style="margin-left: 50px;">
			<tr>
				<td>Item ID :</td>
				<td><input type="text" name="txtItemID" style="padding: 10px;" disabled=""/></td>
			</tr>
			<tr>
				<td>Item Name :</td>
				<td><input type="text" name="txtItemName" style="padding: 10px;"/></td>
			</tr>
			<tr>
				<td>Price :</td>
				<td><input type="text" name="txtPrice" style="padding: 10px;"/></td>
			</tr>

			<tr>
				<td>Merchant Name:</td>
			<?php
  				$strSQL = "SELECT * FROM tbl_merchant ";
  				$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
			?>
				<td><select name="Merchant">
			<?php
			 while ($objResult = mysql_fetch_array($objQuery))
			 {
			?>
						<option value="<?php echo $objResult[mer_id];?>"><?php echo $objResult[mer_name];?></option>
			<?php
 			 }
			?>
				</select></td>
			</tr>

			<tr>
				<td></td>
				<td><input type="submit" name="submit" value="submit" style="padding: 10px;"> <input type="reset" name="reset" value="reset" style="padding: 10px;"/></td>
			</tr>
		</table>
		</form>
	</div>
</body>
</html>
